import exp from "constants";
import request from "../request/request";
import {
	getParam
} from "../util";

// 文章推荐
export const recommendArticle = () => request('get', 'article-recommend');

// 文献推荐
export const recommendLiterature = (name, page = null, size = null) => {
	const query = {
		page,
		size,
		filters: {
			name
		}
	};
	return request("get", 'literature-recommend' + getParam(query));
};

// 文献字典
export const dictLiterature = () => request("get", "dict-literature-list");

// 文献列表
export const literatureList = (page, size, id, name) => {
	const query = {
		page,
		size,
		filters: {
			name
		}
	}
	return request("get", `literature-list/${id}${getParam(query)}`)
};

// 文章字典
export const dictArticle = () => request("get", "dict-article-list");

// 文章列表
export const articleList = (id, page, size, name) => {
	const query = {
		page,
		size,
		filters: {
			name
		}
	}
	return request('get', `article-list/${id}${getParam(query)}`);
}

// 区域字典
export const dictArea = () => request("get", "dict-region-list");

// 区域详情
export const areaDetail = id => request("get", `region-detail/${id}`);

// 关联文献
export const areaLiterature = (id) => request("get", `relation-literature-list/${id}`);

// 关联文献
export const areaArticle = (id) => request("get", `relation-article-list/${id}`);

// 文章详情
export const articleDetail = (id) => request("get", `article-detail/${id}`);

// 文献详情
export const literatureDetail = (id) => request("get", `literature-detail/${id}`);
